﻿@model Coslen.TahorCRM.Domain.Entities.ViewModels.Editing.AddressTypeEditViewModel
@{
    ViewBag.Title = "Printable Calendar";
    Layout = "~/Views/Shared/_NoLayout.cshtml";
}
@section HeaderIncludes{
    <!-- JavaScript Includes -->
    <script src="@Url.Content("~/Scripts/fullcalendar.js")" type="text/javascript"></script>
    <!-- Style Sheets -->
    <link href="@Url.Content("~/Content/fullcalendar.css")" rel="stylesheet" type="text/css" />
}
<script type="text/javascript">
    $(document).ready(function () {
        // page is now ready, initialize the calendar...
        $('#calendar').fullCalendar({
            eventSources: [

            // your event source
                {
                url: '/Events/Event/GetMonthsEvents',
                type: 'GET',
                data: {
                    userId: '@(ViewBag.TahorUser == null? "0" : ViewBag.TahorUser.UserId)'
                },
                error: function () {
                    alert('there was an error while fetching events!');
                }
            }

            // any other sources...

            ]
        });

    });
</script>
<div id="calendar">
</div>
